package net.xdclass.pay;

import com.alipay.api.AlipayApiException;
import lombok.extern.slf4j.Slf4j;
import net.xdclass.ProductOrderApplication;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.math.BigDecimal;

/**
 * @Classname alipay
 * @Description TODO
 * @Date 2022/5/26 19:02
 * @Created by sunhao
 */
@RunWith(SpringRunner.class)
@SpringBootTest(classes = ProductOrderApplication.class)
@Slf4j
public class alipay {

  @Autowired
  private AliPayService aliPayService;

  @Test
  public void testPay()  {
    try {
      Boolean aBoolean = aliPayService.AliPay("11294515155595915", new BigDecimal("1.00"), "测试商品");
      System.out.println(aBoolean);
    } catch (AlipayApiException e) {
      e.printStackTrace();
    }
  }


}
